/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c) 2002, GeoVISTA Center
 * Licensed under Simplified BSD License
 * This library is developed and distributed for free usage,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * You can redistribute and/or modify it under the terms of the
 * Simplified BSD License
 *
 *
 *
 *
 *
 * 
 *
 * @original author: jin Chen 
 * @author: jin Chen 
 * @date: Jan 25, 2008$
 * @version: 1.0
 */
package edu.psu.geovista.app.gmap.utils;

import edu.psu.geovista.app.gmap.SimpleGeoMap;
import edu.psu.geovista.app.vit.pub.utils.VitUtils;

import javax.swing.*;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

public class MapConfigure extends JPanel {
    public static final String PP_Draw_Blur="DBlur";
    PropertyChangeSupport ppspt;
    SimpleGeoMap map;
     /** Creates new form MapConfigurePane */
    public MapConfigure(SimpleGeoMap map) {
         this.map=map;
        initComponents();
         customize();
    }

    private void customize(){
        ppspt=new PropertyChangeSupport(this);
        this.BlurDrawChk.setSelected(true); 
    }
    public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
        this.ppspt.addPropertyChangeListener(listener);
    }
    
   public void show(){
        VitUtils.showDialog(null,this,"Configuration",null);

    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        BlurDrawChk = new javax.swing.JCheckBox();

        BlurDrawChk.setText("Blur Drawing");
        BlurDrawChk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BlurDrawChkActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(BlurDrawChk)
                .addContainerGap(289, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(BlurDrawChk)
                .addContainerGap(219, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(40, Short.MAX_VALUE))
        );
    }// </editor-fold>

private void BlurDrawChkActionPerformed(java.awt.event.ActionEvent evt) {
    //this.ppspt.firePropertyChange(PP_Draw_Blur,false,this.BlurDrawChk.isSelected());
    this.map.setUseBlur(this.BlurDrawChk.isSelected());
}


    // Variables declaration - do not modify
    private javax.swing.JCheckBox BlurDrawChk;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration

}

